package com.idealighter.game.core.dao.generate.mapper;

import com.idealighter.game.core.dao.generate.domain.BlackListDomain;
import com.idealighter.game.core.dao.generate.domain.BlackListDomainExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface BlackListDomainMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table black_list
     *
     * @mbg.generated Tue Aug 14 14:13:21 CST 2018
     */
    @SelectProvider(type=BlackListDomainSqlProvider.class, method="countByExample")
    long countByExample(BlackListDomainExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table black_list
     *
     * @mbg.generated Tue Aug 14 14:13:21 CST 2018
     */
    @DeleteProvider(type=BlackListDomainSqlProvider.class, method="deleteByExample")
    int deleteByExample(BlackListDomainExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table black_list
     *
     * @mbg.generated Tue Aug 14 14:13:21 CST 2018
     */
    @Delete({
        "delete from black_list",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table black_list
     *
     * @mbg.generated Tue Aug 14 14:13:21 CST 2018
     */
    @Insert({
        "insert into black_list (limit_type, limit_action, ",
        "limit_value, end_time)",
        "values (#{limitType,jdbcType=VARCHAR}, #{limitAction,jdbcType=VARCHAR}, ",
        "#{limitValue,jdbcType=VARCHAR}, #{endTime,jdbcType=TIMESTAMP})"
    })
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Integer.class)
    int insert(BlackListDomain record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table black_list
     *
     * @mbg.generated Tue Aug 14 14:13:21 CST 2018
     */
    @InsertProvider(type=BlackListDomainSqlProvider.class, method="insertSelective")
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Integer.class)
    int insertSelective(BlackListDomain record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table black_list
     *
     * @mbg.generated Tue Aug 14 14:13:21 CST 2018
     */
    @SelectProvider(type=BlackListDomainSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="limit_type", property="limitType", jdbcType=JdbcType.VARCHAR),
        @Result(column="limit_action", property="limitAction", jdbcType=JdbcType.VARCHAR),
        @Result(column="limit_value", property="limitValue", jdbcType=JdbcType.VARCHAR),
        @Result(column="end_time", property="endTime", jdbcType=JdbcType.TIMESTAMP)
    })
    List<BlackListDomain> selectByExample(BlackListDomainExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table black_list
     *
     * @mbg.generated Tue Aug 14 14:13:21 CST 2018
     */
    @Select({
        "select",
        "id, limit_type, limit_action, limit_value, end_time",
        "from black_list",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="limit_type", property="limitType", jdbcType=JdbcType.VARCHAR),
        @Result(column="limit_action", property="limitAction", jdbcType=JdbcType.VARCHAR),
        @Result(column="limit_value", property="limitValue", jdbcType=JdbcType.VARCHAR),
        @Result(column="end_time", property="endTime", jdbcType=JdbcType.TIMESTAMP)
    })
    BlackListDomain selectByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table black_list
     *
     * @mbg.generated Tue Aug 14 14:13:21 CST 2018
     */
    @UpdateProvider(type=BlackListDomainSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") BlackListDomain record, @Param("example") BlackListDomainExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table black_list
     *
     * @mbg.generated Tue Aug 14 14:13:21 CST 2018
     */
    @UpdateProvider(type=BlackListDomainSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") BlackListDomain record, @Param("example") BlackListDomainExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table black_list
     *
     * @mbg.generated Tue Aug 14 14:13:21 CST 2018
     */
    @UpdateProvider(type=BlackListDomainSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(BlackListDomain record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table black_list
     *
     * @mbg.generated Tue Aug 14 14:13:21 CST 2018
     */
    @Update({
        "update black_list",
        "set limit_type = #{limitType,jdbcType=VARCHAR},",
          "limit_action = #{limitAction,jdbcType=VARCHAR},",
          "limit_value = #{limitValue,jdbcType=VARCHAR},",
          "end_time = #{endTime,jdbcType=TIMESTAMP}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(BlackListDomain record);
}